// 
// Decompiled by Procyon v0.5.36
// 

package com.orange.boot.dev1.controller;

import org.springframework.web.bind.annotation.PostMapping;
import io.swagger.annotations.ApiOperation;
import java.io.IOException;
import com.orange.boot.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import com.orange.boot.dev1.service.NewsOverviewService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({"/dev1/crawler"})
@Api(
        tags = {"惠农网爬虫"}
)
public class NewsOverviewController {
    @Autowired
    private NewsOverviewService newsOverviewService;

    public NewsOverviewController() {
    }

    @ApiOperation("定时爬取网站内容并存入数据库")
    @PostMapping({"timing"})
    public R crawler() {
        System.out.println("爬虫方法被调用");

        try {
            this.newsOverviewService.timingCraw();
        } catch (IOException var2) {
            throw new RuntimeException(var2);
        }

        return R.ok();
    }
}

